package com.fourhats.model;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name="visitEntity")
public class VisitEntity extends com.fourhats.model.Entity {

	public VisitEntity() {
	}
	
	public VisitEntity(User user, long entityId, int entityType) {
		super();
		this.user = user;
		this.entityId = entityId;
		this.entityType = entityType;
		this.date = new Date();
	}

	@OneToOne(cascade = CascadeType.ALL)
	@JoinColumn(name = "userId")
	private User user;
	
	@Column(name="entityId")
	private long entityId;
	
	@Column(name="entityType")
	private int entityType;
	
	@Column(name="date")
	private Date date;

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public long getEntityId() {
		return entityId;
	}

	public void setEntityId(long entityId) {
		this.entityId = entityId;
	}

	public int getEntityType() {
		return entityType;
	}

	public void setEntityType(int entityType) {
		this.entityType = entityType;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}
}
